use libc;
use std::env;
use std::process;
pub fn main() -> () {
    let args: Vec<String> = env::args().collect();
    if args.len() != 2 {
        println!("Usage: {} <index>", args[0]);
        process::exit(1);
    }
    let idx: libc::c_int = args[1].parse().unwrap_or(0);
    if idx < 1 || idx > NUM_STUDENTS {
        println!("Invalid index, should be between 1 and {}", NUM_STUDENTS);
        process::exit(-1);
    }
    unsafe {
        printGrades(idx);
    }
}
